#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::vector;
using std::swap;
using std::distance;

void Input(vector <int> *list) {
    int count;
    cin >> count;
    list->reserve(count);
    int element;
    for (int i(0); i < count; ++i) {
        cin >> element;
        list->push_back(element);
    }
}

template <typename iterator = vector <int>::iterator>
void Merge(iterator first_begin, iterator first_end,
    iterator second_begin, iterator second_end,
    iterator result_begin) {
    iterator result_current = result_begin;
    while (first_begin != first_end ||
        second_begin != second_end) {
        if (second_begin == second_end ||
            (first_begin != first_end &&
            *first_begin <= *second_begin)) {
            *result_current = *first_begin;
            ++result_current;
            ++first_begin;
        }
        else if (first_begin == first_end ||
            (second_begin != second_end &&
            *first_begin > *second_begin)) {
            *result_current = *second_begin;
            ++result_current;
            ++second_begin;
        }
    }
}

void Output(vector <int>::iterator iterator_begin,
    vector <int>::iterator iterator_end) {
    for (auto i = iterator_begin; i != iterator_end; ++i) {
        cout << *i << " ";
    }
}

template <typename iterator = vector <int>::iterator>
void Sort_merge(iterator iterator_begin, iterator iterator_end,
    iterator help_begin) {
    if (iterator_begin + 1 < iterator_end) {
        auto iterator_middle = iterator_begin +
            distance(iterator_begin, iterator_end) / 2;
        Sort_merge(iterator_begin, iterator_middle, help_begin);
        Sort_merge(iterator_middle, iterator_end, help_begin);
        Merge(iterator_begin, iterator_middle,
            iterator_middle, iterator_end, help_begin);
        iterator help_begin_copy = help_begin;
        for (auto iterator_main = iterator_begin;
            iterator_main != iterator_end; ++iterator_main) {
            *iterator_main = *help_begin_copy;
            ++help_begin_copy;
        }
    }
}

int main() {
    vector <int> list, help;
    Input(&list);
    help.resize(list.size());
    Sort_merge(list.begin(), list.end(), help.begin());
    Output(list.begin(), list.end());
}